package com.yanqu.road.entity.activity.drink;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_activity_drink_user_data")
public class DrinkUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "积分")
    private long score;

    @FieldTypeAnnotation(desc = "体力")
    private int energy;

    @FieldTypeAnnotation(desc = "上次恢复时间")
    private long lastRecTime;

    @FieldTypeAnnotation(desc = "新手引导位置")
    private int guideIndex = 0;

    @FieldTypeAnnotation(desc = "方块列表（1倍）")
    private int[][] blockList1 = new int[6][7];
    @FieldTypeAnnotation(desc = "方块列表（8倍）")
    private int[][] blockList4 = new int[6][7];
    @FieldTypeAnnotation(desc = "方块列表（16倍）")
    private int[][] blockList16 = new int[6][7];

    @FieldTypeAnnotation(desc = "订单（1倍）")
    private DrinkOrder order1 = new DrinkOrder();
    @FieldTypeAnnotation(desc = "订单（8倍）")
    private DrinkOrder order4 = new DrinkOrder();
    @FieldTypeAnnotation(desc = "订单（16倍）")
    private DrinkOrder order16 = new DrinkOrder();

    @FieldTypeAnnotation(desc = "待领奖订单列表（1倍）")
    private List<DrinkOrder> waitRewardOrderList1 = new ArrayList<>();
    @FieldTypeAnnotation(desc = "待领奖订单列表（8倍）")
    private List<DrinkOrder> waitRewardOrderList4 = new ArrayList<>();
    @FieldTypeAnnotation(desc = "待领奖订单列表（16倍）")
    private List<DrinkOrder> waitRewardOrderList16 = new ArrayList<>();

    @FieldTypeAnnotation(desc = "1倍后续订单")
    private List<Integer> orderIdList1 = new ArrayList<>();
    @FieldTypeAnnotation(desc = "8倍后续订单")
    private List<Integer> orderIdList4 = new ArrayList<>();
    @FieldTypeAnnotation(desc = "16倍后续订单")
    private List<Integer> orderIdList16 = new ArrayList<>();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if (this.energy != energy) {
            this.energy = energy;
            setOp(DataStatus.Update);
        }
    }

    public long getLastRecTime() {
        return lastRecTime;
    }

    public void setLastRecTime(long lastRecTime) {
        if (this.lastRecTime != lastRecTime) {
            this.lastRecTime = lastRecTime;
            setOp(DataStatus.Update);
        }
    }

    public int getGuideIndex() {
        return guideIndex;
    }

    public void setGuideIndex(int guideIndex) {
        if (this.guideIndex != guideIndex) {
            this.guideIndex = guideIndex;
            setOp(DataStatus.Update);
        }
    }

    public int[][] getBlockList1() {
        return blockList1;
    }

    public void setBlockList1(int[][] blockList1) {
        if (null == blockList1) {
            return;
        }
        this.blockList1 = blockList1;
        setOp(DataStatus.Update);
    }

    public int[][] getBlockList4() {
        return blockList4;
    }

    public void setBlockList4(int[][] blockList4) {
        if (null == blockList4) {
            return;
        }
        this.blockList4 = blockList4;
        setOp(DataStatus.Update);
    }

    public DrinkOrder getOrder1() {
        return order1;
    }

    public void setOrder1(DrinkOrder order1) {
        if (null == order1) {
            return;
        }
        this.order1 = order1;
        setOp(DataStatus.Update);
    }

    public DrinkOrder getOrder4() {
        return order4;
    }

    public void setOrder4(DrinkOrder order4) {
        if (null == order4) {
            return;
        }
        this.order4 = order4;
        setOp(DataStatus.Update);
    }

    public List<DrinkOrder> getWaitRewardOrderList1() {
        return waitRewardOrderList1;
    }

    public void setWaitRewardOrderList1(List<DrinkOrder> waitRewardOrderList1) {
        if (null == waitRewardOrderList1) {
            return;
        }
        this.waitRewardOrderList1 = waitRewardOrderList1;
        setOp(DataStatus.Update);
    }

    public List<DrinkOrder> getWaitRewardOrderList4() {
        return waitRewardOrderList4;
    }

    public void setWaitRewardOrderList4(List<DrinkOrder> waitRewardOrderList4) {
        if (null == waitRewardOrderList4) {
            return;
        }
        this.waitRewardOrderList4 = waitRewardOrderList4;
        setOp(DataStatus.Update);
    }

    public List<Integer> getOrderIdList1() {
        return orderIdList1;
    }

    public void setOrderIdList1(List<Integer> orderIdList1) {
        if (null == orderIdList1) {
            return;
        }
        this.orderIdList1 = orderIdList1;
        setOp(DataStatus.Update);
    }

    public List<Integer> getOrderIdList4() {
        return orderIdList4;
    }

    public void setOrderIdList4(List<Integer> orderIdList4) {
        if (null == orderIdList4) {
            return;
        }
        this.orderIdList4 = orderIdList4;
        setOp(DataStatus.Update);
    }

    public int[][] getBlockList16() {
        return blockList16;
    }

    public void setBlockList16(int[][] blockList16) {
        if (null == blockList16) {
            return;
        }
        this.blockList16 = blockList16;
        setUpdateOption();
    }

    public DrinkOrder getOrder16() {
        return order16;
    }

    public void setOrder16(DrinkOrder order16) {
        if (null == order16) {
            return;
        }
        this.order16 = order16;
        setUpdateOption();
    }

    public List<DrinkOrder> getWaitRewardOrderList16() {
        return waitRewardOrderList16;
    }

    public void setWaitRewardOrderList16(List<DrinkOrder> waitRewardOrderList16) {
        if (null == waitRewardOrderList16) {
            return;
        }
        this.waitRewardOrderList16 = waitRewardOrderList16;
        setUpdateOption();
    }

    public List<Integer> getOrderIdList16() {
        return orderIdList16;
    }

    public void setOrderIdList16(List<Integer> orderIdList16) {
        if (null == orderIdList16) {
            return;
        }
        this.orderIdList16 = orderIdList16;
        setUpdateOption();
    }

    // ===================================================================

    public int[][] getBlockList(int multi) {
        if (multi == 1) return blockList1;
        if (multi == 8) return blockList4;
        if (multi == 16) return blockList16;
        return null;
    }

    public void setBlockList(int[][] blockList, int multi) {
        if (null == blockList) {
            return;
        }
        if (multi == 1) this.blockList1 = blockList;
        else if (multi == 8) this.blockList4 = blockList;
        else if (multi == 16) this.blockList16 = blockList;
        setOp(DataStatus.Update);
    }

    public DrinkOrder getOrder(int multi) {
        if (multi == 1) return order1;
        if (multi == 8) return order4;
        if (multi == 16) return order16;
        return null;
    }

    public void setOrder(DrinkOrder order, int multi) {
        if (null == order) {
            return;
        }
        if (multi == 1) this.order1 = order;
        else if (multi == 8) this.order4 = order;
        else if (multi == 16) this.order16 = order;
        setOp(DataStatus.Update);
    }

    public List<DrinkOrder> getWaitRewardOrderList(int multi) {
        if (multi == 1) return waitRewardOrderList1;
        if (multi == 8) return waitRewardOrderList4;
        if (multi == 16) return waitRewardOrderList16;
        return null;
    }

    public void setWaitRewardOrderList(List<DrinkOrder> waitRewardOrderList, int multi) {
        if (null == waitRewardOrderList) {
            return;
        }
        if (multi == 1) this.waitRewardOrderList1 = waitRewardOrderList;
        else if (multi == 8) this.waitRewardOrderList4 = waitRewardOrderList;
        else if (multi == 16) this.waitRewardOrderList16 = waitRewardOrderList;
        setOp(DataStatus.Update);
    }

    public List<Integer> getOrderIdList(int multi) {
        if (multi == 1) return orderIdList1;
        if (multi == 8) return orderIdList4;
        if (multi == 16) return orderIdList16;
        return null;
    }

    public void setOrderIdList(List<Integer> orderIdList, int multi) {
        if (null == orderIdList) {
            return;
        }
        if (multi == 1) this.orderIdList1 = orderIdList;
        else if (multi == 8) this.orderIdList4 = orderIdList;
        else if (multi == 16) this.orderIdList16 = orderIdList;
        setOp(DataStatus.Update);
    }

    // =============== 以下不需要入库 ================

    private long lastTipsTime = 0L;

    public long getLastTipsTime() {
        return lastTipsTime;
    }

    public void setLastTipsTime(long lastTipsTime) {
        this.lastTipsTime = lastTipsTime;
    }
}
